<?php

declare(strict_types=1);

namespace Modules\Base\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $order_id
 * @property $doc_type
 * @property $material_no
 * @property $from_lotnum
 * @property $lot_num
 * @property $qty
 * @property $location
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
*/
class BoxTurnover extends Model
{


    protected $table = 'box_turnover';

    protected $fillable = [ 'id', 'order_id', 'doc_type', 'material_no', 'from_lotnum', 'lot_num', 'qty', 'location', 'creator_id', 'created_at', 'updated_at', 'deleted_at' ];

    /**
     * @var array
     */
    protected array $fields = ['order_id','doc_type','material_no','from_lotnum','lot_num','qty','location'];

    /**
     * @var array
     */
    protected array $form = ['id','order_id','doc_type','material_no','from_lotnum','lot_num','qty','location','created_at','updated_at'];

    /**
     * @var array
     */
    public array $searchable = [
        'doc_type' => '=',
        'material_no' => '=',
        'from_lotnum' => '=',
        'lot_num' => '=',
        'location' => '=',
        ];

    /**
     * 时间格式化
     * @param $date
     * @return mixed
     */
    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i');
    }
}
